#include"Library.h"
#include"Student.h"
#include<iostream>
using namespace std;
int main()
{

	Observer *pObs1 = new Student("John");
	Observer *pObs2 = new Student("Tom");
	Observer *pObs3 =  new Student("Mary");
	//Library *pLib = new Library();
	auto_ptr<Subject> pLib(new Library());
	pLib->SetData("Design Pattern");
	pLib->Attach(pObs1);
	pLib->Attach(pObs2);
	pLib->Attach(pObs3);
	
	pLib->Notify();
	cout<<"*********************"<<endl;

	pLib->Detach(pObs2);
	pLib->Notify();
	//delete pLib;
	cin.get();
	return 0;
}